Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Saving Movies


FlattenMovieData

The FlattenMovieData function creates a new movie file and creates a new movie that contains all of its movie data. However, unlike the FlattenMovie function described in the previous section, this function does not add the new movie resource to the new movie file. Instead, the FlattenMovieData function returns the new movie to your application. Your application must dispose of the returned movie.

pascal Movie FlattenMovieData (Movie theMovie, 
                              long movieFlattenFlags, 
                              const FSSpec *theFile,
                        OSType creator, 
                        ScriptCode scriptTag,
                        long createMovieFileFlags);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
movieFlattenFlags
Controls the process of adding movie data to the new movie file. These flags affect how the toolbox adds movies to the new movie file later. The following flags are available (be sure to set unused flags to 0):
flattenAddMovieToDataFork
Causes the movie to be placed in the data fork of the new movie file. You may use this flag to create single-fork movie files, which can be more easily moved to other computer systems from your Macintosh.
flattenDontInterleaveFlatten
Allows you to disable the Movie Toolbox's data storage optimizations. By default, the Movie Toolbox stores movie data in a format that is optimized for the storage device. Set this flag to 1 to disable these optimizations.
flattenActiveTracksOnly
Causes the Movie Toolbox to add only enabled movie tracks to the new movie file. You can use the SetTrackEnabled function, which is described on page 2-132, to enable and disable movie tracks.
theFile
Contains a pointer to the file system specification for the movie file to be created.
creator
Specifies the creator value for the new file.
scriptTag
Specifies the script in which the movie file should be created. Set this parameter to smSystemScript to use the system script; set it to smCurrentScript to use the current script. See Inside Macintosh: Text for more information about scripts and script tags.
creationFlags
Controls file creation options. The following flag is available:
createMovieFileDeleteCurFile
Indicates whether to delete an existing file. If you set this flag to 1, the Movie Toolbox deletes the file (if it exists) before creating the new movie file. If this flag is set to 0 and the file specified by the fileSpec parameter already exists, the Movie Toolbox uses the existing file. In this case, the toolbox ensures that the file has both a data and a resource fork. If this flag isn't set, the data is appended to the file.
DESCRIPTION
The FlattenMovieData function returns the movie identifier of the new movie. If the function could not create the movie, it sets this returned identifier to nil.

You can also use this function to create a single-fork movie file. Set the flattenAddMovieToDataFork flag in the movieFlattenFlags parameter to 1. The Movie Toolbox then places the movie into the data fork of the movie file.

The Movie Toolbox calls your progress function during long operations.

The Movie Toolbox does not alter the source movie.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
progressProcAborted-2019Your progress function returned an error
cantCreateSingleForkFile-2022Error trying to create a single-fork file
File Manager errors
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996